//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Diagnostics;
using OpenLS.Core.Serialization;
using OpenLS.Drawing.Serialization;

namespace OpenLS.Drawing
{
    public class GraphicalObjectFrameLocking : IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        Boolean _noGrp;
        Boolean _noDrilldown;
        Boolean _noSelect;
        Boolean _noChangeAspect;
        Boolean _noMove;
        Boolean _noResize;
        private OfficeArtExtensionList _extLst;

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {


            using (var c = context.Read(DrawingConstants.DrawingNamespace + "graphicFrameLocks"))
            {
                _noGrp = c.GetOptionalBoolean("noGrp", false);
                _noDrilldown = c.GetOptionalBoolean("noDrilldown", false);
                _noSelect = c.GetOptionalBoolean("noSelect", false);
                _noChangeAspect = c.GetOptionalBoolean("noChangeAspect", false);
                _noMove = c.GetOptionalBoolean("noMove", false);
                _noResize = c.GetOptionalBoolean("noResize", false);
                _extLst = c.ReadOptionalElement<OfficeArtExtensionList>("extLst");

            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write(DrawingConstants.DrawingNamespace + "graphicFrameLocks"))
            {
c.SetOptionalBoolean("noGrp",_noGrp,false);
c.SetOptionalBoolean("noDrilldown",_noDrilldown,false);
c.SetOptionalBoolean("noSelect",_noSelect,false);
c.SetOptionalBoolean("noChangeAspect",_noChangeAspect,false);
c.SetOptionalBoolean("noMove",_noMove,false);
c.SetOptionalBoolean("noResize",_noResize,false);
c.WriteOptionalElement(_extLst);
            }
        }

        #endregion
    }
}